
/*幻灯片*/

$(function(){
    var img = $("#img");
    var ali = $("#img li");
    var time = null;
    var inow = 0;
    img.width(ali.length*240);
    function tab() {
        img.animate({left:-inow * 240},400)
    }
    function autoPlay() {
        inow++;
        if (inow >= ali.length) {
            inow = 0
        }
        tab();
    };
    $("#abroadNews .slideLeft").click(function(){
        
        inow++;
        if(inow>ali.length-1){
            inow=0;
        };
        tab();
    });
    $("#abroadNews .slideLeft,#abroadNews .slideRight,#abroadNews .imageBox").mouseover(function(){
        window.clearInterval(time)
    })
    $("#abroadNews .slideLeft,#abroadNews .slideRight,#abroadNews .imageBox").mouseout(function(){
       time = window.setInterval(autoPlay, 2000);   
    });
    $("#abroadNews .slideRight").click(function(){
        window.clearInterval(time);
        inow--;
        if(inow<0){
            inow=ali.length-1;
        };
        tab();
        
    })
    time = window.setInterval(autoPlay, 2000);  
})

/*下拉菜单*/
$(function(){
    $('.title_content .nav .itemsCount').hover(
    function(){
        $(this).children('a').addClass('active');
        $(this).find('.items').show();
    },function(){
        $(this).children('a').removeClass('active');
        $(this).find('.items').hide();  
    })  
})
;
